#include "logging.h"

#define VERTICAL			40 
#define HORIZONTAL			20
#define MAX_SNAKE_LENGTH	(VERTICAL * HORIZONTAL)
#define HIGH				1
#define DOWN				2
#define LEFT				3
#define RIGHT				4

//Struct to save the position of the head from the snake
struct coordinates 
{
	int hight;
	int wide;
};

class SNAKE_handle
{
private:
	struct coordinates head;
	int body_elements;
	int last_direction;
	static int instanceCount;
	char *snake_body	[ MAX_SNAKE_LENGTH ];
	bool feeding ( char Snake_field[][VERTICAL]  );
	char *food;
	bool check_food ( int body, char Snake_field[][VERTICAL], struct coordinates next_food );
	void set_food ( char Snake_field[][VERTICAL] );
	inline void if_fooding( char Snake_field[][VERTICAL] );
public:
	SNAKE_handle();
	bool self_eat ( char Snake_field[][VERTICAL] );
	void snake_move ( char Snake_field[][VERTICAL] );
	void User_input ( void );
	void show ( char Snake_field[][VERTICAL] );
	void set_snake ( char Snake_field[][VERTICAL] );
};